home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Celestin Apprentice 5
/
Apprentice-Release5.iso
/
Source Code
/
Libraries
/
Evaluate
/
TestEval.c
< prev
next >
Wrap
C/C++ Source or Header
|
1994-05-28
|
523b
|
41 lines
/*
TestEval- a very simple shell to see if the evaluate library works
*/
#include "Evaluate.h"
#include "Sane.h"
#include "stdio.h"
main()
{
extended x;
Str255 expr = "\psin(2*x)/x";
OSErr theErr;
decform format;
printf("Expression: %#s\n",expr);
x = 2.0;
theErr = Evaluate(&expr,&x);
if (theErr)
{
SysBeep(1);
NumToString(theErr,&expr);
printf("Error %#s\n",expr);
}
else
{
format.style = FIXEDDECIMAL;
format.digits = 8;
num2str(&format,x,&expr);
printf("%#s\n",expr);
}
}